home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-SPAR.{_A / FBIO.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  10KB  |  316 lines

  1. #ifndef __LINUX_FBIO_H
  2. #define __LINUX_FBIO_H
  3.  
  4. /* Constants used for fbio SunOS compatibility */
  5. /* (C) 1996 Miguel de Icaza */
  6.  
  7. /* Frame buffer types */
  8. #define FBTYPE_NOTYPE           -1
  9. #define FBTYPE_SUN1BW           0   /* mono */
  10. #define FBTYPE_SUN1COLOR        1 
  11. #define FBTYPE_SUN2BW           2 
  12. #define FBTYPE_SUN2COLOR        3 
  13. #define FBTYPE_SUN2GP           4 
  14. #define FBTYPE_SUN5COLOR        5 
  15. #define FBTYPE_SUN3COLOR        6 
  16. #define FBTYPE_MEMCOLOR         7 
  17. #define FBTYPE_SUN4COLOR        8 
  18.  
  19. #define FBTYPE_NOTSUN1          9 
  20. #define FBTYPE_NOTSUN2          10
  21. #define FBTYPE_NOTSUN3          11
  22.  
  23. #define FBTYPE_SUNFAST_COLOR    12  /* cg6 */
  24. #define FBTYPE_SUNROP_COLOR     13
  25. #define FBTYPE_SUNFB_VIDEO      14
  26. #define FBTYPE_SUNGIFB          15
  27. #define FBTYPE_SUNGPLAS         16
  28. #define FBTYPE_SUNGP3           17
  29. #define FBTYPE_SUNGT            18
  30. #define FBTYPE_SUNLEO           19      /* zx Leo card */
  31. #define FBTYPE_MDICOLOR         20      /* cg14 */
  32. #define FBTYPE_TCXCOLOR        21    /* SUNW,tcx card */
  33.  
  34. #define FBTYPE_LASTPLUSONE      21    /* This is not last + 1 in fact... */
  35.  
  36. /* Does not seem to be listed in the Sun file either */
  37. #define FBTYPE_CREATOR          22
  38.  
  39. #define FBTYPE_PCI_GENERIC    1000
  40. #define FBTYPE_PCI_MACH64    1001
  41.  
  42. /* fbio ioctls */
  43. /* Returned by FBIOGTYPE */
  44. struct  fbtype {
  45.         int     fb_type;        /* fb type, see above */
  46.         int     fb_height;      /* pixels */
  47.         int     fb_width;       /* pixels */
  48.         int     fb_depth;
  49.         int     fb_cmsize;      /* color map entries */
  50.         int     fb_size;        /* fb size in bytes */
  51. };
  52. #define FBIOGTYPE _IOR('F', 0, struct fbtype)
  53.  
  54. struct  fbcmap {
  55.         int             index;          /* first element (0 origin) */
  56.         int             count;
  57.         unsigned char   *red;
  58.         unsigned char   *green;
  59.         unsigned char   *blue;
  60. };
  61.  
  62. #ifdef __KERNEL__
  63. #define FBIOPUTCMAP_SPARC _IOW('F', 3, struct fbcmap)
  64. #define FBIOGETCMAP_SPARC _IOW('F', 4, struct fbcmap)
  65. #else
  66. #define FBIOPUTCMAP _IOW('F', 3, struct fbcmap)
  67. #define FBIOGETCMAP _IOW('F', 4, struct fbcmap)
  68. #endif
  69.  
  70. /* # of device specific values */
  71. #define FB_ATTR_NDEVSPECIFIC    8
  72. /* # of possible emulations */
  73. #define FB_ATTR_NEMUTYPES       4
  74.  
  75. struct fbsattr {
  76.         int     flags;
  77.         int     emu_type;    /* -1 if none */
  78.         int     dev_specific[FB_ATTR_NDEVSPECIFIC];
  79. };
  80.  
  81. struct fbgattr {
  82.         int     real_type;    /* real frame buffer type */
  83.         int     owner;        /* unknown */
  84.         struct fbtype fbtype;    /* real frame buffer fbtype */
  85.         struct fbsattr sattr;   
  86.         int     emu_types[FB_ATTR_NEMUTYPES]; /* supported emulations */
  87. };
  88. #define FBIOSATTR  _IOW('F', 5, struct fbgattr) /* Unsupported: */
  89. #define FBIOGATTR  _IOR('F', 6, struct fbgattr)    /* supported */
  90.  
  91. #define FBIOSVIDEO _IOW('F', 7, int)
  92. #define FBIOGVIDEO _IOR('F', 8, int)
  93.  
  94. /* Cursor position */
  95. struct fbcurpos {
  96. #ifdef __KERNEL__
  97.     short fbx, fby;
  98. #else
  99.         short x, y;
  100. #endif
  101. };
  102.  
  103. /* Cursor operations */
  104. #define FB_CUR_SETCUR   0x01    /* Enable/disable cursor display */
  105. #define FB_CUR_SETPOS   0x02    /* set cursor position */
  106. #define FB_CUR_SETHOT   0x04    /* set cursor hotspot */
  107. #define FB_CUR_SETCMAP  0x08    /* set color map for the cursor */
  108. #define FB_CUR_SETSHAPE 0x10    /* set shape */
  109. #define FB_CUR_SETALL   0x1F    /* all of the above */
  110.  
  111. struct fbcursor {
  112.         short set;              /* what to set, choose from the list above */
  113.         short enable;           /* cursor on/off */
  114.         struct fbcurpos pos;    /* cursor position */
  115.         struct fbcurpos hot;    /* cursor hot spot */
  116.         struct fbcmap cmap;     /* color map info */
  117.         struct fbcurpos size;   /* cursor bit map size */
  118.         char *image;            /* cursor image bits */
  119.         char *mask;             /* cursor mask bits */
  120. };
  121.  
  122. /* set/get cursor attributes/shape */
  123. #define FBIOSCURSOR     _IOW('F', 24, struct fbcursor)
  124. #define FBIOGCURSOR     _IOWR('F', 25, struct fbcursor)
  125.  
  126. /* set/get cursor position */
  127. #define FBIOSCURPOS     _IOW('F', 26, struct fbcurpos)
  128. #define FBIOGCURPOS     _IOW('F', 27, struct fbcurpos)
  129.  
  130. /* get max cursor size */
  131. #define FBIOGCURMAX     _IOR('F', 28, struct fbcurpos)
  132.  
  133. /* wid manipulation */
  134. struct fb_wid_alloc {
  135. #define FB_WID_SHARED_8        0
  136. #define FB_WID_SHARED_24    1
  137. #define FB_WID_DBL_8        2
  138. #define FB_WID_DBL_24        3
  139.     __u32    wa_type;
  140.     __s32    wa_index;    /* Set on return */
  141.     __u32    wa_count;    
  142. };
  143. struct fb_wid_item {
  144.     __u32    wi_type;
  145.     __s32    wi_index;
  146.     __u32    wi_attrs;
  147.     __u32    wi_values[32];
  148. };
  149. struct fb_wid_list {
  150.     __u32    wl_flags;
  151.     __u32    wl_count;
  152.     struct fb_wid_item    *wl_list;
  153. };
  154.  
  155. #define FBIO_WID_ALLOC    _IOWR('F', 30, struct fb_wid_alloc)
  156. #define FBIO_WID_FREE    _IOW('F', 31, struct fb_wid_alloc)
  157. #define FBIO_WID_PUT    _IOW('F', 32, struct fb_wid_list)
  158. #define FBIO_WID_GET    _IOWR('F', 33, struct fb_wid_list)
  159.  
  160. /* Creator ioctls */
  161. #define FFB_IOCTL    ('F'<<8)
  162. #define FFB_SYS_INFO        (FFB_IOCTL|80)
  163. #define FFB_CLUTREAD        (FFB_IOCTL|81)
  164. #define FFB_CLUTPOST        (FFB_IOCTL|82)
  165. #define FFB_SETDIAGMODE        (FFB_IOCTL|83)
  166. #define FFB_GETMONITORID    (FFB_IOCTL|84)
  167. #define FFB_GETVIDEOMODE    (FFB_IOCTL|85)
  168. #define FFB_SETVIDEOMODE    (FFB_IOCTL|86)
  169. #define FFB_SETSERVER        (FFB_IOCTL|87)
  170. #define FFB_SETOVCTL        (FFB_IOCTL|88)
  171. #define FFB_GETOVCTL        (FFB_IOCTL|89)
  172. #define FFB_GETSAXNUM        (FFB_IOCTL|90)
  173. #define FFB_FBDEBUG        (FFB_IOCTL|91)
  174.  
  175. /* Cg14 ioctls */
  176. #define MDI_IOCTL          ('M'<<8)
  177. #define MDI_RESET          (MDI_IOCTL|1)
  178. #define MDI_GET_CFGINFO    (MDI_IOCTL|2)
  179. #define MDI_SET_PIXELMODE  (MDI_IOCTL|3)
  180. #    define MDI_32_PIX     32
  181. #    define MDI_16_PIX     16
  182. #    define MDI_8_PIX      8
  183.  
  184. struct mdi_cfginfo {
  185.     int     mdi_ncluts;     /* Number of implemented CLUTs in this MDI */
  186.         int     mdi_type;       /* FBTYPE name */
  187.         int     mdi_height;     /* height */
  188.         int     mdi_width;      /* widht */
  189.         int     mdi_size;       /* available ram */
  190.         int     mdi_mode;       /* 8bpp, 16bpp or 32bpp */
  191.         int     mdi_pixfreq;    /* pixel clock (from PROM) */
  192. };
  193.  
  194. /* SparcLinux specific ioctl for the MDI, should be replaced for
  195.  * the SET_XLUT/SET_CLUTn ioctls instead
  196.  */
  197. #define MDI_CLEAR_XLUT       (MDI_IOCTL|9)
  198.  
  199. /* leo & ffb ioctls */
  200. struct fb_clut_alloc {
  201.     __u32    clutid;    /* Set on return */
  202.      __u32    flag;
  203.      __u32    index;
  204. };
  205.  
  206. struct fb_clut {
  207. #define FB_CLUT_WAIT    0x00000001    /* Not yet implemented */
  208.      __u32    flag;
  209.      __u32    clutid;
  210.      __u32    offset;
  211.      __u32    count;
  212.      char *    red;
  213.      char *    green;
  214.      char *    blue;
  215. };
  216.  
  217. struct fb_clut32 {
  218.      __u32    flag;
  219.      __u32    clutid;
  220.      __u32    offset;
  221.      __u32    count;
  222.      __u32    red;
  223.      __u32    green;
  224.      __u32    blue;
  225. };
  226.  
  227. #define LEO_CLUTALLOC    _IOWR('L', 53, struct fb_clut_alloc)
  228. #define LEO_CLUTFREE    _IOW('L', 54, struct fb_clut_alloc)
  229. #define LEO_CLUTREAD    _IOW('L', 55, struct fb_clut)
  230. #define LEO_CLUTPOST    _IOW('L', 56, struct fb_clut)
  231. #define LEO_SETGAMMA    _IOW('L', 68, int) /* Not yet implemented */
  232. #define LEO_GETGAMMA    _IOR('L', 69, int) /* Not yet implemented */
  233.  
  234. #ifdef __KERNEL__
  235. /* Addresses on the fd of a cgsix that are mappable */
  236. #define CG6_FBC    0x70000000
  237. #define CG6_TEC    0x70001000
  238. #define CG6_BTREGS 0x70002000
  239. #define CG6_FHC    0x70004000
  240. #define CG6_THC    0x70005000
  241. #define CG6_ROM    0x70006000
  242. #define CG6_RAM    0x70016000
  243. #define CG6_DHC    0x80000000
  244.  
  245. #define CG3_MMAP_OFFSET 0x4000000
  246.  
  247. /* Addresses on the fd of a tcx that are mappable */
  248. #define TCX_RAM8BIT           0x00000000
  249. #define TCX_RAM24BIT           0x01000000
  250. #define TCX_UNK3           0x10000000
  251. #define TCX_UNK4           0x20000000
  252. #define TCX_CONTROLPLANE       0x28000000
  253. #define TCX_UNK6           0x30000000
  254. #define TCX_UNK7           0x38000000
  255. #define TCX_TEC            0x70000000
  256. #define TCX_BTREGS         0x70002000
  257. #define TCX_THC            0x70004000
  258. #define TCX_DHC            0x70008000
  259. #define TCX_ALT               0x7000a000
  260. #define TCX_SYNC           0x7000e000
  261. #define TCX_UNK2            0x70010000
  262.  
  263. /* CG14 definitions */
  264.  
  265. /* Offsets into the OBIO space: */
  266. #define CG14_REGS        0       /* registers */
  267. #define CG14_CURSORREGS  0x1000  /* cursor registers */
  268. #define CG14_DACREGS     0x2000  /* DAC registers */
  269. #define CG14_XLUT        0x3000  /* X Look Up Table -- ??? */
  270. #define CG14_CLUT1       0x4000  /* Color Look Up Table */
  271. #define CG14_CLUT2       0x5000  /* Color Look Up Table */
  272. #define CG14_CLUT3       0x6000  /* Color Look Up Table */
  273. #define CG14_AUTO     0xf000
  274.  
  275. #endif /* KERNEL */
  276.  
  277. /* These are exported to userland for applications to use */
  278. /* Mappable offsets for the cg14: control registers */
  279. #define MDI_DIRECT_MAP 0x10000000
  280. #define MDI_CTLREG_MAP 0x20000000
  281. #define MDI_CURSOR_MAP 0x30000000
  282. #define MDI_SHDW_VRT_MAP 0x40000000
  283.  
  284. /* Mappable offsets for the cg14: frame buffer resolutions */
  285. /* 32 bits */
  286. #define MDI_CHUNKY_XBGR_MAP 0x50000000
  287. #define MDI_CHUNKY_BGR_MAP 0x60000000
  288.  
  289. /* 16 bits */
  290. #define MDI_PLANAR_X16_MAP 0x70000000
  291. #define MDI_PLANAR_C16_MAP 0x80000000
  292.  
  293. /* 8 bit is done as CG3 MMAP offset */
  294. /* 32 bits, planar */
  295. #define MDI_PLANAR_X32_MAP 0x90000000
  296. #define MDI_PLANAR_B32_MAP 0xa0000000
  297. #define MDI_PLANAR_G32_MAP 0xb0000000
  298. #define MDI_PLANAR_R32_MAP 0xc0000000
  299.  
  300. /* Mappable offsets on leo */
  301. #define LEO_SS0_MAP            0x00000000
  302. #define LEO_LC_SS0_USR_MAP     0x00800000
  303. #define LEO_LD_SS0_MAP         0x00801000
  304. #define LEO_LX_CURSOR_MAP      0x00802000
  305. #define LEO_SS1_MAP            0x00803000
  306. #define LEO_LC_SS1_USR_MAP     0x01003000
  307. #define LEO_LD_SS1_MAP         0x01004000
  308. #define LEO_UNK_MAP            0x01005000
  309. #define LEO_LX_KRN_MAP         0x01006000
  310. #define LEO_LC_SS0_KRN_MAP     0x01007000
  311. #define LEO_LC_SS1_KRN_MAP     0x01008000
  312. #define LEO_LD_GBL_MAP         0x01009000
  313. #define LEO_UNK2_MAP           0x0100a000
  314.  
  315. #endif /* __LINUX_FBIO_H */
  316.